﻿@using YuFeng.Models.Product;
@model List<Product>
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.SecondTitle = "首页";
    var introduce = ViewBag.Introduce as YuFeng.Models.New.News;
    var contactUs = ViewBag.ContactUs as YuFeng.Models.New.News;
}
<div class="page-wrap">
    @Html.Partial("_Header")
    @Html.Partial("_Banner")
    <ul class="top-menu clearfix">
        <li>
            <a href="/home/IntoYuFeng">公司简介</a>
        </li>
        <li>
            <a href="/home/ProductCenter">产品介绍</a>
        </li>
        <li>
            <a href="/home/honor">资质荣誉</a>
        </li>
        <li>
            <a href="/home/Application">操作流程</a>
        </li>
        <li>
            <a href="/home/newscenter">新闻中心</a>
        </li>
        <li>
            <a href="/home/contactus">联系我们</a>
        </li>
    </ul>
    <div class="content">
        <div class="content-box clearfix">
            <p class="content-box-title">关于我们</p>
            <div class="col-xs-4 no-padding">
                <img class="show-big-img" src="@(!string.IsNullOrWhiteSpace(introduce.TitleImg)?YuFeng.Web.Helpers.FilesHelper.GetNewsTitleImg(introduce.TitleImg):"/assets/images/about-us.png")" width="100%" />
            </div>
            <div class="col-xs-8 padding-right-0 about-us-text text-left">
                <p style="text-indent:2em;">
                    @(introduce.Summary.Length > 100 ? (introduce.Summary.Substring(0, 100) + "...") : introduce.Summary)
                    <a class="for-more-link" href="/home/IntoYuFeng">[更多]</a>
                </p>
            </div>
        </div>
        <div class="content-box clearfix">
            <p class="content-box-title">产品介绍</p>
            <ul class="product-list clearfix">

                @foreach (Product product in Model)
                {
                    <li>
                        <a href="/home/ProductDetail?id=@product.Id">
                            <img src="@YuFeng.Web.Helpers.FilesHelper.GetProductImg(product.TitleImg)" width="100%"/>
                            <p>@product.Name</p>
                        </a>
                    </li>
                }
            </ul>
            <p class="for-more-product">
                <a href="/home/productcenter">查看更多产品>></a>
            </p>
        </div>
        <div class="content-box clearfix">
            <p class="content-box-title">联系我们</p>
            <div class="col-xs-5 no-padding">
                <img class="show-big-img" src="@(!string.IsNullOrWhiteSpace(contactUs.TitleImg)?YuFeng.Web.Helpers.FilesHelper.GetNewsTitleImg(contactUs.TitleImg):"/assets/images/contactUs-1.png")" width="100%"/>
            </div>
            <div class="col-xs-7 padding-right-0">
                @*<ul class="list-unstyled small-font-size text-left">
                        <li>南通御丰塑钢包装有限公司</li>
                        <li>阿里搜索：“南通御丰塑钢包装有限公司”</li>
                        <li>网址：www.yfsg.com</li>
                        <li>电话：0513-86678258 6678991</li>
                        <li>邮箱：sales@yfsg.com nt@yfsg.com</li>
                        <li>传真：0513-80166998</li>
                        <li>地址：江苏省南通市通州区先锋工业园区</li>
                    </ul>*@
                <p>@Html.Raw(contactUs.Summary)</p>
            </div>
        </div>
    </div>
    @Html.Partial("_Footer")
</div>
@section scripts
{
    <script type="text/javascript">
        $(function () {
            $('.banner').scrolling();
        });

        var preLoading = function (events) {
            var images = [];
            var imgs = document.images;
            for (var i = 0; i < imgs.length; i++) {
                images.push(imgs[i].src);
            }

            images.push('@Url.Content("~/assets/images/banner-1.png")');
            images.push('@Url.Content("~/assets/images/logo.png")');
            images.push('@Url.Content("~/assets/images/menu-1.png")');
            images.push('@Url.Content("~/assets/images/menu-2.png")');
            images.push('@Url.Content("~/assets/images/menu-3.png")');
            images.push('@Url.Content("~/assets/images/menu-4.png")');
            images.push('@Url.Content("~/assets/images/menu-5.png")');

            imgLoading(images, {
                complete: function () {
                    events.complete();
                }
            });
        };
        $(function () {
            preLoading({
                complete: function () {
                    // 页面预加载结束；
                    $(".loader").hide();
                    $(".page-wrap").show();
                }
            });
        });
    </script>
}